package com.uphone.magicleafteacher.pro.adapter;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.uphone.magicleafteacher.R;
import com.uphone.magicleafteacher.pro.activity.DetailsActivity;
import com.uphone.magicleafteacher.util.CommonUtil;
import com.uphone.magicleafteacher.view.MyBaseViewHolder;
import com.uphone.magicleafteacher.vo.HomeWorBean;

import java.util.List;

public class FinishWorkAdapter extends BaseQuickAdapter<HomeWorBean.HomeWorksBean, MyBaseViewHolder> {

    public FinishWorkAdapter(int layoutResId, @Nullable List<HomeWorBean.HomeWorksBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull MyBaseViewHolder helper, HomeWorBean.HomeWorksBean item) {
        helper.setText(R.id.text_finishname, item.getStudentName());
        helper.setText(R.id.text_classworkname, item.getClassName());
        helper.setText(R.id.text_workname, item.getTitle());
        if (item.getProcessStatus() == 1) {
            helper.setImageView(mContext, R.id.img_pi, R.mipmap.teacher_wei);
        } else if (item.getProcessStatus() == 2) {
            helper.setImageView(mContext, R.id.img_pi, R.mipmap.teacher_yi);
        }
    }
}
